package com.eurasia.assignment.domain;

import java.time.LocalDateTime;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 课程实体类
 * 代表学校中的一门课程
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Course {
    
    private Long id;

    private String courseName;
    
    private String courseType;
    
    private Integer credit;
    
    private LocalDateTime createTime;
    
    private Integer selectedCount;
    
    private String description;
    
    public static Course create(String courseName, String courseType, Integer credit, Integer selectedCount,
                              String description) {
        Course newCourse = new Course();
        newCourse.setCourseName(courseName);
        newCourse.setCourseType(courseType);
        newCourse.setCredit(credit);
        newCourse.setCreateTime(LocalDateTime.now());
        newCourse.setSelectedCount(selectedCount);
        newCourse.setDescription(description);
        return newCourse;
    }
} 